Animal = {}
Animal.__index = Animal
setmetatable(Animal,{
    __call = function(class, ...)
      o = setmetatable({}, class)
      return o
    end
})
function Animal.print()
  print("Animal.print")
end


Dog = {}
Dog.__index = Dog
setmetatable(Dog,{
    __index = Animal,
    __call = function(class, ...)
      o = setmetatable({}, class)
      return o
    end
})
function Dog.print()
  print("Dog.print")
end


anim = Animal()
anim.print()

dog = Dog()
dog.print()